Skip to content

feat(status): surface APEX notifications (NOTS) in an Alerts panel#72

Open
Zillatron27 wants to merge 1 commit into
mainfrom
feat/alerts
Open

feat(status): surface APEX notifications (NOTS) in an Alerts panel#72
Zillatron27 wants to merge 1 commit into
mainfrom
feat/alerts

Conversation

@Zillatron27

Copy link
Copy Markdown
Owner

Summary

Second PR of the action-passthrough wave: APEX's notifications surfaced into APXM so you see them without switching — the "NOTS passthrough" from the #30 candidate list, done as pure WebSocket data (no DOM, no buffer driving).

  • The data was already flowing. ALERTS_ALERTS (login snapshot), ALERTS_ALERT (deltas), and ALERTS_ALERTS_DELETED (removals) reached APXM and were dropped as unknown message types. New stores/entities/alerts.ts + three handlers; cleared on reconnect with the other entity stores (stale notifications are worse than none).
  • lib/format-alert.ts — alerts carry no text on the wire (type enum + key/value data; the game composes strings client-side, and rPrun reads the game's rendered DOM — not an option for APXM). Explicit templates for the high-frequency types (CX fills/trades, production finished, ship arrivals, workforce supplies, the contract family, LM ads, warehouse locks); humanized fallback for the rest. Alert type shapes from refined-prun's alerts.types.d.ts (MIT, © 2025 Dan Pavlides).
  • AlertsPanel — new reorderable Status panel (collapsible, default collapsed, "N unread" summary). Unread rows get a dot marker + brightness (not colour alone); rows show category, text, and relative time; capped at 50 with an honest "+N older — see NOTS in APEX" line.
  • Read state is display-only (server read/seen flags). Marking read would require sending a WS message — APXM never does.
  • No migration: reconcileOrder() already appends new panel ids to persisted orders; that upgrade path is now pinned by a test.

Testing

  • 594 tests pass (+14 on this branch): wire-envelope handler dispatch (snapshot/delta/deletion/malformed-discard), reconnect clear (mutation-verified — removing the alerts clear fails 3 tests), formatAlert templates + fallback + hostile-input case, reconcileOrder upgrade path.
  • npx tsc --noEmit clean; Chrome + Firefox builds green.

🤖 Generated with Claude Code

The NOTS buffer's data already travels the WebSocket as first-class
entities (ALERTS_ALERTS login snapshot, ALERTS_ALERT deltas,
ALERTS_ALERTS_DELETED removals) but APXM dropped them as unknown message
types. New alerts entity store + handlers (cleared on reconnect like the
rest), and an AlertsPanel on the Status tab — collapsible, reorderable,
unread-marked (dot + brightness, not colour alone), capped at 50 with an
honest "+N older" line.

Alerts carry no display text on the wire — just a type enum and
key/value data — so lib/format-alert.ts composes the strings APXM shows
(rPrun reads the game-rendered DOM instead, which APXM never displays).
High-frequency types get explicit templates; the rest fall back to a
humanized type name. Alert type shapes from refined-prun's
alerts.types.d.ts (MIT, (c) 2025 Dan Pavlides).

Read state is server-driven and display-only: marking read would mean
sending a WS message, which APXM never does. reconcileOrder() appends
the new panel id to persisted orders, so no migration.

Part of the passthrough wave; references #30 (fork candidate list).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
apxm 9c44a97 Jul 06 2026, 11:06 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant